import request from '@/utils/request'

// 获取AI方案列表
export function fetchList(params) {
  return request({
    url: '/api/ai-scheme/list',
    method: 'get',
    params
  })
}

// 创建AI方案
export function createScheme(data) {
  return request({
    url: '/api/ai-scheme/create',
    method: 'post',
    data
  })
}

// 更新AI方案
export function updateScheme(data) {
  return request({
    url: '/api/ai-scheme/update',
    method: 'put',
    data
  })
}

// 删除AI方案
export function deleteScheme(id) {
  return request({
    url: `/api/ai-scheme/delete/${id}`,
    method: 'delete'
  })
}

// 审核AI方案
export function auditScheme(data) {
  return request({
    url: '/api/ai-scheme/audit',
    method: 'post',
    data
  })
}

// 发布AI方案
export function publishScheme(id) {
  return request({
    url: `/api/ai-scheme/publish/${id}`,
    method: 'post'
  })
}

// 获取方案详情
export function getSchemeDetail(id) {
  return request({
    url: `/api/ai-scheme/detail/${id}`,
    method: 'get'
  })
}

// 获取审核列表
export function fetchAuditList(params) {
  return request({
    url: '/api/ai-scheme/audit-list',
    method: 'get',
    params
  })
}

// 生成AI方案
export function generateScheme(data) {
  return request({
    url: '/api/ai-scheme/generate',
    method: 'post',
    data
  })
}

// 获取方案统计
export function getSchemeStats() {
  return request({
    url: '/api/ai-scheme/stats',
    method: 'get'
  })
}
